package com.itbaizhan.config;

import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.client.RestTemplate;

/**
 * @author spf
 * @date 2024/5/10
 * @time 15:14
 */
@Configuration
public class RestTemplateConfigure {

    @Bean
    public RestTemplate restTemplate(RestTemplateBuilder builder){
        RestTemplate restTemplate = builder.build();
        restTemplate.setErrorHandler(new CustomerResponseHandler());
        return restTemplate;
    }

}
